<?php

/**
 * This file is part of the Pagizer package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright   Copyright (c) 2010 Advisa (http://www.advisa.fr)
 * @author      Pagizer Core Team <team@pagizer.org>
 * @package     pagizer
 * @subpackage  medias
 */

class m_medias_actions_AjaxDownloadFileAction extends m_backoffice_extends_Action
{
	public function execute()
	{
        $docId = $this->getRequestParameter("docId");
        $docLang = $this->getRequestParameter("docLang");

        if($this->getDocumentProvider()->checkDocument($docId,$docLang))
        {
            $media = $this->getDocumentProvider()->getByModelAndUniqueId("modules_medias/media", $docId, $docLang);
            $media->downloadFile();
        }
	}	
}